package com.csmy.form;

import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import javax.swing.JLabel;
import java.awt.FlowLayout;
import java.awt.CardLayout;

public class nextForm {

	private JFrame frame;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					nextForm window = new nextForm();
					window.frame.setVisible(true);
					
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the application.
	 */
	public nextForm() {
		initialize();
	}

	/**
	 * Initialize the contents of the frame.
	 */
	private void initialize() {
		frame = new JFrame();
		frame.setBounds(100, 100, 450, 300);
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		JPanel top = new JPanel();
		frame.getContentPane().add(top, BorderLayout.NORTH);

		JButton btnButton1 = new JButton("\u4E0A\u4E00\u9875");
		
		top.add(btnButton1);

		JButton btnButton2 = new JButton("\u4E0B\u4E00\u9875");
		

		top.add(btnButton2);

		JPanel bot = new JPanel();
		FlowLayout fl_bot = (FlowLayout) bot.getLayout();
		fl_bot.setAlignment(FlowLayout.LEFT);
		frame.getContentPane().add(bot, BorderLayout.SOUTH);

		JLabel label = new JLabel("\u63D0\u793A\u6D88\u606F");
		bot.add(label);

		final JPanel cen = new JPanel();
		frame.getContentPane().add(cen, BorderLayout.CENTER);
		cen.setLayout(new CardLayout(0, 0));

		JButton button = new JButton("\u6309\u94AE\u4E00");
		cen.add(button, "name_10120067422077");

		JButton button_1 = new JButton("\u6309\u94AE\u4E8C");
		cen.add(button_1, "name_10122661451565");

		JButton button_2 = new JButton("\u6309\u94AE\u4E09");
		cen.add(button_2, "name_10137443539066");
		
		
		btnButton2.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				CardLayout 	cardLayout=(CardLayout)cen.getLayout();
				cardLayout.next(cen);
			}
		});
		
		
		btnButton1.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				CardLayout 	cardLayout=(CardLayout)cen.getLayout();
				cardLayout.previous(cen);
			}
		});
	}

	
}
